<!DOCTYPE html>
<html>
<head>
<title>{$site_name}</title>
<meta name="keywords" content="{$site_seo_keywords}" />
<meta name="description" content="{$site_seo_description}">
<meta name="author" content="ThinkCMF">
<tc_include file="Public:head" />
</head>

<body class="body-white" id="top">
	<tc_include file="Public:nav" />

		<div class="container tc-main">
                <div class="row">
                    <div class="span3">
	                    <tc_include file="Public:usernav"/>
                    </div>
                    <div class="span9">
                           <div class="tabs">
                               <ul class="nav nav-tabs">
                                   <li class="active"><a href="#one" data-toggle="tab"><i class="fa fa-comments-o"></i>在线充值</a></li>
                               </ul>
                               <div class="tab-content">
                                   <div class="tab-pane active" id="one">
                                   			<div class="form-horizontal">
                                   			<div class="control-group">
                                   				<label class="control-label" for="check_ol_bl_pay">充值方式</label>
                                   				<div class="controls">
 <input type="radio" name="check_ol_bl_pay" id="xiansh" value="0" onclick="SelectPayTypes(0)" checked="checked">线上支付
  <input type="radio" name="check_ol_bl_pay" id="xianx"  value="1" onclick="SelectPayTypes(1)">	线下支付
                                   				</div>
                                   			</div>
                                   		</div>
                                   		<form class="form-horizontal J_ajaxForms" name="incharge_form" id="incharge_xianshang" action="{:U('User/Money/paying')}" method="post" />
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-password">充值金额</label>
                                   				<div class="controls">
                                   					<input type="text" class="span2" placeholder="金额" id="money" name="money"> 元
                                   				</div>
                                   			</div>
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-repassword">支付方式</label>
                                   				<div class="controls">
                                   					<foreach name="config" item="payvo">
						                                 <div style="float:left;"><input type="radio" name="payment" value="{$payvo.id}">&nbsp;{$payvo.name}</div>
						                             </foreach>
                                   				</div>
                                   			</div>
                                   			<div class="control-group">
                                   				<div class="controls">
                                   					<button type="submit" class="btn J_ajax_submit_btns" id="incharge_done">确定充值</button>
                                   				</div>
                                   			</div>
                                   		</form>
                                   		
                                   	 <form class="form-horizontal J_ajaxForms" name="incharge_form" id="incharge_xianxia" action="{:U('User/Money/index',array('act'=>'incharge'))}" method="post" >
									<div class="control-group">
                                   				<label class="control-label" for="input-repassword">充值金额：</label>
										<div class="controls">
										<input type="text" class="f-input f_l" id="money" name="money" />元
										</div>
                              		</div>
									<div class="control-group">
                                   				<label class="control-label" for="input-repassword">银行流水号：</label>
										<div class="controls">
										<input type="text" class="f-input f_l" id="money" value="" name="memo" />
										</div>
                              		</div>
									
										<div class="control-group">
                                   				<label class="control-label" for="input-repassword">充值银行：</label>
											<div class="controls">
													
													
													<foreach name="pay" item="paytype">
													
															
				
														<div class="f_l obitem"><input type="radio" value="{$paytype.id}" name="payment">{$paytype.name} &nbsp;&nbsp;&nbsp;&nbsp;      收款人：{$paytype.config.receiver}  |  收款帐号：{$paytype.config.account}  |  开户行：{$paytype.config.subname}</div>
													
												</foreach>
													
													
												</div>
                              				</div>
										
										<div class="control-group">
                                   				<label class="control-label" for="input-repassword">验证码：</label>
											<div class="controls">
											<input type="text" class="f-input f_l span2" id="money" value="" name="verify" />
											{:sp_verifycode_img('code_len=4&font_size=15&width=100&height=35&charset=1234567890')}		
												</div>
										</div>
                              				
										<div class="control-group">
										
                                   			<div class="controls">
											<button type="submit" class="btn J_ajax_submit_btns" id="incharge_done">确定充值</button>
											</div>	
										</div>
									</form>
                                   		
                         
	
                                </div>
                                   </div>
                               </div>							
                               
                               
                           </div>
                    </div>
                </div>

		<tc_include file="Public:footer" />

	</div>
	<!-- /container -->

	<tc_include file="Public:scripts" />
	<script type="text/javascript">
		SelectPayTypes(0);
		function SelectPayTypes(id){
			if(id){
				$("#incharge_xianshang").css("display","none");
				$("#incharge_xianxia").css("display","block");
				$("#xianx").attr("checked", true);
			}else{
				$("#incharge_xianshang").css("display","block");
				$("#incharge_xianxia").css("display","none");
				$("#xiansh").attr("checked", true);
			}
		}
		

		$("#incharge_done").each(function(){
			
			
			$(this).click(function(){
				var forms=$(this).parents('form.J_ajaxForms');
			if($("input[name='check_ol_bl_pay']:checked").val()==0)
			{
				if(!($("input[name='money']",forms).val()!=''&&!isNaN($("input[name='money']",forms).val())&&$("input[name='money']",forms).val()>0))			
				{
					$.showErr("请输入正确的充值金额");
					return false;
				}
			}else{
				
				if(!($("input[name='money']",forms).val()!=''&&!isNaN($("input[name='money']",forms).val())&&$("input[name='money']",forms).val()>0))			
				{
					$.showErr("请输入正确的充值金额");
					return false;
				}
				if($("input[name='memo']",forms).val()==''){
					$.showErr("请输入正确的银行流水号");
					return false;
				}
				if($("input[name='verify']",forms).val()==''){
					$.showErr("请输入正确的验证码");
					return false;
				}
			}
			
			if(!$("input[name='payment']:checked",forms).val())
			{
				$.showErr("请选择支付方式");
				return false;
			}
			
		});
			
		});
</script>
	
	
</body>
</html>